#{extends 'noTab.html' /}
#{set title: 'Advanced Search Results' /}
<h1 class="viewTitle">Advanced Search Results</h1>

<div class="viewContent">
<a href="@{Browse.advancedSearch()}">Back to Advanced Search page</a>
<br/><br/>
<h3>${ideaResultsList.size() ?: 'No'} idea(s) match(es) your search
	preferences.</h3>


<br/>
#{list items:ideaResultsList, as:'idea'}
<div class="idea">
	<a href="@{Browse.viewIdea(idea.id)}" class="standardLink">${idea.title}</a>
	<br/>
	<p>Creator: ${idea.creator.name}.<br/>Published ${idea.getPublishedSince()}</p>
	<br/>
</div>

#{/list}
<br/><br/>
<h3>${topicResultsList.size() ?: 'No'} topic(s) match(es) your
	search preferences</h3>


<br/>
#{list items:topicResultsList, as:'topic'}
<div class="topic">
	<a href="@{Browse.viewTopic(topic.id)}" class="standardLink">${topic.name}</a>
	<p>Almost ${topic.ideas.size() ?: 'NO'} idea(s) are published.</p>
</div>
#{/list}
<br/><br/>

<h3>${planResultsList.size() ?: 'No'} plan(s) match(es) your
	search preferences</h3>


<br/>
#{list items:planResultsList, as:'plan'}
<div class="plan">
	<a href="@{Application.showPlan(plan.id)}" class="standardLink">${plan.title}</a>
	<p>Executing ${plan.ideas.size() ?: 'No'} idea(s).</p>
</div>
#{/list}

<br/>
<h3>${entityResultsList.size() ?: 'No'} entity(ies) match(es) your
	search preferences</h3>



#{list items:entityResultsList, as:'entity'}
<div class="entity">
	<a href="@{Browse.viewEntity(entity.id)}" class="standardLink">${entity.name}</a>
	<p>Discussing approximately ${entity.topics.size()?: 'ZERO'} topic(s).</p>
</div>
#{/list}

<br/><br/>
<h3>${organizationResultsList.size() ?: 'No'} organization(s) match(es) your
	search preferences</h3>


<br/>
#{list items:organizationResultsList, as:'organization'}
<div class="topic">
	<a href="@{Browse.viewOrganization(organization.id)}" class="standardLink">${organization.name}</a>
	<p>Divided into ${organization.entities.size() ?: 'ZERO'} entities.</p>
</div>
#{/list}

</div>